import java.io.*;

import java.util.*;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;

public class Devise extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
		
		Random generator = new Random();
		Double dollarValue = generator.nextDouble() * 40.0 + 10.0;
		
		//((ServletRequest) response).setAttribute("dollar", dollarValue.toString() );
		
			
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Test ok!</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("dollar "+dollarValue.toString()+"\n");
        out.println("</body>");
        out.println("</html>");
        
    }
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
		
		Random generator = new Random();
		Double dollarValue = generator.nextDouble() * 40.0 + 10.0;
		
		((ServletRequest) response).setAttribute("dollar", dollarValue.toString() );
		
        
    }
	public void execute(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
		
		Random generator = new Random();
		Double dollarValue = generator.nextDouble() * 40.0 + 10.0;
		
		((ServletRequest) response).setAttribute("dollar", dollarValue.toString() );
		
		
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Test ok!</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>Test ok!</h1>");
        out.println("</body>");
        out.println("</html>");
		
        
    }
}